package cn.hiapi.shopkeeper.entity.order;

import cn.hiapi.basic.entity.BasicEntity;
import cn.hiapi.basic.serializer.LongToStringSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author AdinZ
 * @date 2023/1/2 23:59
 */
@Entity
@Table(name = "hiapi_shopkeeper_activity_lottery_order")
@ApiModel(description = "抽奖记录")
@Getter
@Setter
public class ActivityLotteryOrder extends BasicEntity {
    @Id
    @GeneratedValue(generator = "snowflake")
    @GenericGenerator(name = "snowflake", strategy = "cn.hiapi.basic.id.SnowflakeId")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;

    @ApiModelProperty("店铺id")
    private long shopId;
    @ApiModelProperty("买家id")
    private long buyerId;

    @ApiModelProperty("活动id")
    private long aid;

    @ApiModelProperty("订单id")
    private long oid;

    @ApiModelProperty("状态 0 未抽奖,1已抽奖")
    private int status;

    @ApiModelProperty("中奖状态, 0未中奖,1已中奖")
    private int lotteryState;

    @ApiModelProperty("商品名称")
    private String title;
    @ApiModelProperty("商品图片")
    private String thumb;
    @ApiModelProperty("商品价格")
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal price = BigDecimal.ZERO;

    @ApiModelProperty("创建时间")
    private long created = System.currentTimeMillis();

    @ApiModelProperty("更新时间")
    private long updated = System.currentTimeMillis();


}
